
<style>
  div#left-up, #left-down, #right-up, #right-down{
        float: left;
        width: 400px;
        padding: 10px 10px 10px 10px;
  }
  div#left-up{
        float: left;
        width: 45%;
        margin-right:10px;
        border:1px solid #C3D2DF;
  }
  div#right-up{
        float: left;
        width: 45%;
        border:1px solid #C3D2DF;
  }
  div#middle{
        float: left;
        width: 95%;
        border:1px solid #C3D2DF;
        padding: 10px 10px 10px 10px;
  }
  div.middle-item{
    float: left;
    margin: 10px 20px 10px 0;
  }
  div#howToUseIt{
    width:70%;
    background-color:#EFF5FF;
    margin: 0 0 10px 0;
    padding: 5px 5px 5px 15px;
  }
  div#bottomDiv{
    float:left;
    width:95%;
    border:1px solid #C3D2DF;
    margin-top:10px;
    padding: 5px 5px 5px 10px;
  }
</style>

<p class="smallNav">
  <%= link_to "普通测试管理", :action => "index"  %>>>
  编辑量表
</p>
<br/>
<div id="howToUseIt">
  <p>
    <!--
    <font color="#FFAFAF">操作顺序</font>&nbsp;&nbsp;&nbsp;&nbsp;添加分量表 &nbsp;->&nbsp;
    为每个分量表添加题目 &nbsp;->&nbsp; 添加维度 &nbsp;->&nbsp; 编辑维度 &nbsp;->&nbsp;
    定义常模 &nbsp;->&nbsp; 量表制作完成
    -->
  <p>
</div>

<div>
  <b>测试名称：<%= @survey.name %></b>
  （<font color="red"><%=@question_num%></font>）&nbsp;&nbsp;
  <%= link_to "修改基本信息", {:id => @survey, :action => :edit_info} %>
  <br/>
  <b>说明</b><br/>
  <p>
   <%= @survey.description %>
  </p>
  <br/><br/>
</div>

<div id="wrapper">

  <div>

      <% if @survey.has_dimen %>
      <div id="right-up">
        维度&nbsp;&nbsp;
        <%=link_to "添加维度", {:id => @survey, :action => :new_dimen} %><br/><br/>
        <% @survey.dimens.each do |d| %>
          <span id="dimen_<%=d.id%>"><%= d.name %>&nbsp;
            (<font color=red><%= d.questions.size %></font>)
          </span>
          <%= link_to "编辑", :action => "edit_dimen", :id => d%> &nbsp;&nbsp;&nbsp;&nbsp;
        <% end %>
        <% if @survey.dimens.size == 0 %>
          维度没有定义
        <% end %>
        <br/><br/>
      </div>
      <% end %>

  </div>
  
  <div id="middle" style="margin-top:10px">
    <b>题目</b>&nbsp;&nbsp;
    <% if @survey.has_part != 1 %>
    <%= link_to '编辑题目', {:id => @survey, :action => :new_question } %>
    <% end %>
    <br/><br/>
  
 
  </div>

</div>
<script type="text/javascript">
  function heighlight(el){
    new Effect.Highlight(el, {duration: 2})
  }

  if(null != "<%= flash[:dimen_id] %>" && "" != "<%= flash[:dimen_id] %>") {
    heighlight("dimen_<%= flash[:dimen_id] %>");
  }

  if(null != "<%= flash[:part_id] %>" && "" != "<%= flash[:part_id] %>") {
    heighlight("part_<%= flash[:part_id] %>");
  }

  window.onload = function() {
    
  }
</script>

